import React from 'react';
import {
  View,
  Text,
  TouchableOpacity,
  TouchableHighlight,
  Image,
} from 'react-native';

import TImage from '../../components/TImage';
import SizeUtils from '../../common/SizeUtils';
import Constants from '../../common/Constants';
import Config from '../../config';
import HeartEapItemView from './HeartEapItemView';
import CommonDataListView from '../common/CommonDataListView';
import HeartEapRequestAction from '../../actions/heart/HeartEapRequestAction';

export default class HeartEapListView extends CommonDataListView {
  constructor(props) {
    super(props);

    this._dataKey = "activity_id";
  }

  _getStyle() {
    return {height:this.props.style.height,width:SizeUtils.getWindowSize().width};
  }

  _onRenderItem(data, index) {
    if(this.props.onRenderItem != undefined) {
      return this.props.onRenderItem(data,index);
    }
    return (<HeartEapItemView data={data} />);
  }

  _requestData(page) {
    if (!this.props.isThisRequest) {
      new HeartEapRequestAction().call(this, {page:page,tag:0,page_size:10})
    }
    if(this.props.requestData != undefined) {
      this.props.requestData(page, this);
    }
  }
}
